const getList = ([x, ...y]) => [x, y]
const getUser = user => ({ name: user.name, age: user.age }) //? 箭头函数要直接返回对象需要加括号 否则会认为是表达式

const list = [1, 2, 3, 4]
const user = { name: "Lydia", age: 21 }

console.log(getList(list)) //? [ 1, [ 2, 3, 4 ] ]
console.log(getUser(user)) //? { name: 'Lydia', age: 21 }
